<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>访问 object 中的属性,将所有属性为val的全部相乘并输出</title>
</head>
<body>
    <script>
        var obj = {
            val: 18
        };
        for(var sak in obj){}// 遍历obj对象
        var arr = obj[sak] * obj[sak];// 让遍历obj对象的属性相乘
        console.log(arr);// 输出相乘后的结果
    </script>
</body>
</html>